# -*- makefile -*-
# vi:se ft=make:

# There can be several subdirectories containing a Modules.utest file.
# Every Modules.utest file in a direct subdirectory is included and evaluated.
# These Modules.utest files are expected to ONLY extend the INTERFACES_UTEST
# and UTEST_SUPPL variables.


UTEST = utest_subsys

UTEST_EXTRA = utest_suppl

# Collect all Modules.utest files in subdirectories to test/utest.
UTEST_SUBDIR_MODULES = $(wildcard $(srcdir)/test/utest/*/Modules.utest)

# New dependencies to be tracked for .Modules.deps generation.
MODULES_FILES += $(srcdir)/test/utest/Modules.utest $(UTEST_SUBDIR_MODULES)

# contains all unit test directories
ALL_UTEST_DIRS = test/utest/framework

# add all relative subdirectory paths with Modules.utest files
ALL_UTEST_DIRS += $(patsubst $(srcdir)/%/,%,$(dir $(UTEST_SUBDIR_MODULES)))

VPATH += $(ALL_UTEST_DIRS)
PRIVATE_INCDIR += $(ALL_UTEST_DIRS)

# Add all test_ files to INTERFACES_UTEST.

# framework
INTERFACES_UTEST := utest_fw
UTEST_SUPPL :=

# Include all existing Modules in subdirectories. They modify INTERFACES_UTEST
# and maybe UTEST_SUPPL.
include $(UTEST_SUBDIR_MODULES)
